"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = __importDefault(require("express")); //ts版的express
const userController_1 = __importDefault(require("./controller/userController"));
const blogController_1 = __importDefault(require("./controller/blogController"));
const blogtypeController_1 = __importDefault(require("./controller/blogtypeController"));
const bannerController_1 = __importDefault(require("./controller/bannerController"));
const blogUserController_1 = __importDefault(require("./controller/blogUserController"));
const leaveController_1 = __importDefault(require("./controller/leaveController"));
const commentController_1 = __importDefault(require("./controller/commentController"));
// import middle from "./middleArea";
let app = (0, express_1.default)(); //产生express对象
// app.get("/", function (req: Request, res: Response) {
//   //get请求启动服务器
//   res.send("hello nodejssd lkh");
// });
app.use("/static", express_1.default.static(__dirname + "/static"));
const bodyParser = require("body-parser");
// post数据最大是50mb
app.use(bodyParser.json({ limit: "50mb" }));
//设置文件上传
const multer = require("multer");
app.use(multer({ dest: "/tmp" }).array("file"));
//运行控制器
// middle(app);
(0, commentController_1.default)(app);
(0, blogUserController_1.default)(app);
(0, blogtypeController_1.default)(app);
(0, bannerController_1.default)(app);
(0, userController_1.default)(app);
(0, leaveController_1.default)(app);
(0, blogController_1.default)(app, __dirname);
app.listen(8080, function () {
    //绑定端口启动服务
    console.log("serve start");
});
